Solutions for Basic Counting and Listing

ثبت نشده
چکیده

CL-1.2 We can form n digit numbers by choosing the leftmost digit AND choosing the next digit AND · · · AND choosing the rightmost digit. The first choice can be made in 9 ways since a leading zero is not allowed. The remaining n − 1 choices can each be made in 10 ways. By the Rule of Product we have 9× 10n−1. To count numbers with at most n digits, we could sum up 9× 10k−1 for 1 ≤ k ≤ n. The sum can be evaluated since it is a geometric series. This does not include the number 0. Whether we add 1 to include it depends on our interpretation of the problem’s requirement that there be no leading zeroes. There is an easier way. We can pad out a number with less than n digits by adding leading zeroes. The original number can be recovered from any such n digit number by stripping off the leading zeroes. Thus we see by the Rule of Product that there are 10 numbers with at most n digits. If we wish to rule out 0 (which pads out to a string of n zeroes), we must subtract 1.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Finding, Counting and Listing All Triangles in Large Graphs, an Experimental Study

In the past, the fundamental graph problem of triangle counting and listing has been studied intensively from a theoretical point of view. Recently, triangle counting has also become a widely used tool in network analysis. Due to the very large size of networks like the Internet, WWW, or social networks, the efficiency of algorithms for triangle counting and listing is an important issue. The m...

متن کامل

Parallel Model Listing and #3SAT Through Ordering Variables

We consider listing and counting all the solutions M to a given Boolean 3SAT formula with n variables. This problem is known to be NP-hard (Garey and Johnson, 1979). A straight-forward enumeration scheme to find M takes worst-case running time O(2n). In this paper, we minimize the total running time and memory requirement by ordering the assignments of parallel values to the literals. Our objec...

متن کامل

Colored Range Queries and Document Retrieval

Colored range queries are a well-studied topic in computational geometry and database research that, in the past decade, have found exciting applications in information retrieval. In this paper we give improved time and space bounds for three important one-dimensional colored range queries — colored range listing, colored range top-k queries and colored range counting — and, thus, new bounds fo...

متن کامل

Algorithms for computing preimages of cellular automata configurations

This paper investigates preimages (ancestors or past configurations) of specified configurations of one-dimensional cellular automata. Both counting and listing of preimages are discussed. The main graphical tools used are the de Bruijn diagram, and its extension the preimage network, which is created by concatenating de Bruijn diagrams. The counting of preimages is performed as multiplication ...

متن کامل

Main-memory triangle computations for very large (sparse (power-law)) graphs

Finding, counting and/or listing triangles (three vertices with three edges) in massive graphs are natural fundamental problems, which received recently much attention because of their importance in complex network analysis. We provide here a detailed survey of proposed main-memory solutions to these problems, in an unified way. We note that previous authors paid surprisingly little attention t...

متن کامل

Solutions for Basic Counting and Listing

CL-1.2 We can form n digit numbers by choosing the leftmost digit AND choosing the next digit AND · · · AND choosing the rightmost digit. The first choice can be made in 9 ways since a leading zero is not allowed. The remaining n − 1 choices can each be made in 10 ways. By the Rule of Product we have 9× 10n−1. To count numbers with at most n digits, we could sum up 9× 10k−1 for 1 ≤ k ≤ n. The s...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007